/*
 * @Author: your name
 * @Date: 2020-06-12 16:12:30
 * @LastEditTime: 2020-06-15 17:50:26
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \codeSnippet\front\nuxt.config.js
 */

module.exports = {
  mode: 'universal',
  /*
  ** Headers of the page
  */
  head: {
    title: process.env.npm_package_name || '',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: process.env.npm_package_description || '' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },
  /*
  ** Customize the progress-bar color
  */
  loading: { color: '#fff' },
  /*
  ** Global CSS
  */
  css: [
    'element-ui/lib/theme-chalk/index.css'
  ],
  /*
  ** Plugins to load before mounting the App
  */
  plugins: [
    '@/plugins/element-ui',
    '@/plugins/axios'
  ],
  /*
  ** Nuxt.js dev-modules
  */
  buildModules: [
  ],
  /*
  ** Nuxt.js modules
  */
  modules: [
    '@nuxtjs/axios',
    '@nuxtjs/proxy'
  ],
  /*
  ** Build configuration
  */
  build: {
    transpile: [/^element-ui/],
    /*
    ** You can extend webpack config here
    */
    extend (config, ctx) {
    }
  },
  proxy:{
    "/api/":{
      target:"http://localhost:7001",
      secure:false,
      pathRewrite:{
        '^/api/':""
      }
    }
  }

  /*

  proxyTable: {
      '/api/java': {
        // target: 'http://localhost:11000',
        //target: 'http://10.18.251.70:11000',
        target: 'http://java-test-oppo.wanyol.com',
        changeOrigin: true,
        pathRewrite: {
          "^/api/java": "/oms"
        }
      },
      '/api': {
        // target: 'http://dev.oms.wanyol.com',
        // 请求测试环境，一般情况下请不要使用，尽量保证dev和test环境放开
        target: 'http://oms1.wwwtest.wanyol.com',
        // 请求212的开发环境
        // target: 'http://oms212.wwwtest.wanyol.com',
        changeOrigin: true,
        pathRewrite: {
          "^/api": "/api"
        }
      }
    },
  */
}
